<?php
require('config.php');

if(!isset($_SESSION['id_user'])){
	$_SESSION['referer_connexion'] =  "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	redirectFront('connexion');
}

if(!isset($_GET['id']) and !isset($_GET['idl'])) die('Missing query string');
if(!is_numeric($_GET['id'])||!is_numeric($_GET['idl'])) die('bad parameter');
$page = new rootLayoutPage();

/*$page->setBaliseTitle('Profile');
$page->setDescription('Profile');
$page->addJavaScript('profil-upload-photo.js');
$page->addJavaScript('ajaxUpload.js');*/

//-- menu Left show products--------------------------------//
$menu = new layoutMenuLeft();
$menuCategorie = new layoutMenuPage();
$menu->pushMenu($menuCategorie);
$menuPage = new layoutMenuPage();
$menu->pushMenu($menuPage);
$page->setMenuPage($menu);

//-- corps de la page --------//
	if(isset($_GET['id']) and isset($_GET['idl'])){
		modelMap::refuseLocation($_GET['id'],$_GET['idl']);		
		Persistence::register(PERSIST_MESSAGE, new Message("The location has been refuse", Message::INFO));
	}

$tpl_file='refuse-place.tpl';
$refuse_place = new flyLayout(REP_TPL . $tpl_file);
$refuse_place->start();
$language_folder = $_SESSION['language_code']==language_default?'':'/'.$_SESSION['language_code'];
//$refuse_place->setVariable('language_folder', $language_folder);

$refuse_place->stop();
$page->setBody($refuse_place);
$page->display();

?>